package com.teaphy.demo;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;

public class SafeVarargsDemo {
	
	@SafeVarargs
	public SafeVarargsDemo(List<String> ...args) {
	}
	
	@SafeVarargs
	public static void doSwim(List<String>... args) {
		System.out.println(Arrays.toString(args));
	}
	
	public static void main(String[] args) {
		Class clz = SafeVarargsDemo.class;
		
		Constructor[] constructors = clz.getConstructors();
		for (Constructor constructor : constructors) {
			System.out.println("constructor - name: " + constructor.getName() + ", parameter type: " + Arrays
				.toString(constructor.getParameterTypes()));
		}
		
		Method[] methods = clz.getMethods();
		for (Method method : methods) {
			System.out.println("method - name: " + method.getName() + ", parameter type: " + Arrays
				.toString(method.getParameterTypes()));
		}
	}
}
